package com.example.moudlec.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.moudlec.dto.ConDto;
import com.example.moudlec.service.Quality_controlService;
import com.mycloud.api.pojo.Quality_control;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/moudlec/quality")
@SuppressWarnings("all")
public class QualityController {
    @Autowired
    Quality_controlService service;

    @RequestMapping("/selConRow")
    Integer selConRow(@RequestParam("orderId") Long orderId, @RequestParam("productId") Integer productId) {
        return service.selConRow(orderId, productId);
    }

    @RequestMapping("/updaCargo")
    public void updaCargo(@RequestParam("orderId") Long orderId, @RequestParam("productId") Integer productId) {
        service.updaCargo(orderId, productId);
    }

    @RequestMapping("/addQc")
    public void addQc(@RequestBody Quality_control quality_control) {
        service.addQc(quality_control);
    }

    @RequestMapping("/selMaxId")
    public Long selMaxId(@RequestParam("orderId") Long orderId, @RequestParam("productId") Integer productId) {
        return service.selMaxId(orderId, productId);
    }

    @RequestMapping("/selController")
    public IPage<Quality_control> selController(Long pageNum, Long pageSize) {
        return service.selController(pageNum, pageSize);
    }

    @RequestMapping("/updconDt")
    public void updconDt(ConDto conDto) {
        service.updconDt(conDto);
    }

    @RequestMapping("/selcheckdt")
    public IPage<Quality_control> selcheckdt(Long pageNum, Long pageSize) {
        return service.selcheckdt(pageNum, pageSize);
    }
}
